//
//  Common.swift
//  XMWeimo
//
//  Created by ios001 on 16/7/20.
//  Copyright © 2016年 itcast. All rights reserved.
//

import UIKit
/*
App Key：770205129
App Secret：adaa0fe0a6cc719885282557d293737f

let APPKEY = "16869948"
let APPSECRET = "a9b4f998a79c3b97fc7a5ad4303d56b0"
*/
// 微博app切换控制器的通知
let WBSwitchRootViewControllerNoti = "WBSwitchRootViewController"
// 表情键盘切换根控制器的通知
let WBEmoticonDeleteButtonNofi = "WBEmoticonDeleteButtonNofi"
// 表情键盘按钮的通知
let WBEmoticonButtonNoti = "WBEmoticonButtonNoti"
 
// 微博账号
//let wbName = "rangyuan05788697@163.com"
//let wbPasswd = "bbb333"
let wbName = "13585511682"
let wbPasswd = "qq836725313"

// 新浪微博相关信息
//let APPKEY = "3414311633"
//let APPSECRET = "008fc6c8bcae365d315971586453645a"
let APPKEY = "3174078670"
let APPSECRET = "07069aada4f5d0869d7f34320f9a404f"

// 回调页
let APPREDIRECT_URL = "http://www.baidu.com"

// app主题颜色
let ThemeColor = UIColor.orangeColor()

// 屏幕宽,高
let SCREENW = UIScreen.mainScreen().bounds.width
let SCREENH = UIScreen.mainScreen().bounds.height
// RGB颜色
func RGB(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat = 1) -> UIColor {
    return UIColor(red: red/255, green: green/255, blue: blue/255, alpha: alpha)
}
// 随机颜色
func RandomColor() ->UIColor{
    let r = random()%256
    let g = random()%256
    let b = random()%256
    return RGB(CGFloat(r), green: CGFloat(g), blue: CGFloat(b))
}

/// 打印
///
/// - parameter message:  打印内容
/// - parameter file:     类名
/// - parameter line:     行数
/// - parameter function: 方法名
func printLog<T>(message: T,file:String = __FILE__, line:Int = __LINE__, function: String = __FUNCTION__){
    // 上线后关闭打印 因为打印消耗性能
//    #if DEBUG
        let f = (file as NSString).lastPathComponent
        let result = "\(f) [\(line)] \(function) : \(message)"
        print(result)
//    #endif
}
  